<!DOCTYPE html>
<html lang="zh-cmn-Hans" xmlns:th="http://www.thymeleaf.org" th:with="title='税收收入排名前10位企业'">
<head th:replace="common/head_query :: common_header_query(~{::link},~{::script})">
    <script type="text/javascript"
            th:src="@{${#servletContext.getAttribute('web.static.url')}+'/echarts2/dist/echarts.js'}"></script>
</head>
<body style="overflow: hidden;">

<div style="height: 500px;width: 100%;" id="queryChars">

</div>

<input th:id="QY_MC" th:value="${QY_MC}" type="hidden"/>
<input th:id="QY_JE" th:value="${QY_JE}" type="hidden"/>
</body>
<script type="text/javascript">
    $("#queryChars").height($(window).height());
    var QY_MC = null;
    if(isNull($('#QY_MC').val())){
        QY_MC = [];
    }else{
        QY_MC = $.parseJSON($('#QY_MC').val());
    }
    var QY_JE = null;
    if(isNull($('#QY_JE').val())){
        QY_JE = [];
    }else{
        QY_JE = $.parseJSON($('#QY_JE').val());
    }
    $(function () {
        require.config({
            paths: {
                echarts: echarts2_dist_url
            }
        });
        require(
            [
                'echarts',
                'echarts/chart/line',
                'echarts/chart/bar'
            ],
            function (ec) {
                var myChart = ec.init(document.getElementById('queryChars'));
                window.onresize = function () {
                    if (myChart) {
                        myChart.resize();
                    }
                };

                var option = {
                    tooltip : {
                        trigger: 'axis'
                    },
                    calculable : true,
                    xAxis : [
                        {
                            type : 'value',
                            boundaryGap : [0, 0.01]
                        }
                    ],
                    yAxis : [
                        {
                            type : 'category',
                            data : QY_MC
                        }
                    ],
                    series: [
                        {
                            name: '年税收收入总额',
                            type: 'bar',
                            barMaxWidth : 30,
                            data: QY_JE
                        }
                    ]
                };
                myChart.setOption(option);

            }
        );
    });
</script>
</html>